﻿using GDM.Hogar.Aplicacion.Formularios.Configuracion;
using GDM.Hogar.Managers.Contratos;
using System;
using System.Windows.Forms;

namespace GDM.Hogar.Aplicacion.Formularios.Mercaderia
{
    public partial class FrmMercaderia
#if DEBUG
 : AdaptadorFrm
#else
            : Frmbase
#endif
    {
        protected override string Titulo
        {
            get { return "Mercaderia"; }
        }

        public FrmMercaderia(IRemitoManager remitoManager, IProveedorManager proveedorManager)
        {
            if (remitoManager == null)
                throw new ArgumentNullException("remitoManager");
            if (proveedorManager == null)
                throw new ArgumentNullException("proveedorManager");

            InitializeComponent();

            var ucProveedor = new ProveedorUC(proveedorManager);
            tpProveedores.Controls.Add(ucProveedor);
        }

        private void tbMercaderia_SelectedIndexChanged(object sender, EventArgs e)
        {
            var tabControl = sender as TabControl;
            if (tabControl == null) return;

            var userControl = tabControl.SelectedTab.Controls[0] as IUserControl;
            if (userControl != null) userControl.LimpiarValidador();
        }
    }
}